<?php

class Admin_Model_DbTable_LessionExamTemp extends Zend_Db_Table_Abstract
{

    protected $_name = 'lession_exam_temp';

    public function getAllLession(){
    	return $this->fetchAll();
    }
    
    public function getLessionByID($eID){
    	return $this->fetchRow("exam_temp_id = $eID");
    }
    
    public function addExamTemp($eID,$eTeacherID,$eMark,$eCol){
    	$data = array(
    			"exam_id"=>$eID,
    			"exam_teacher_id"=>$eTeacherID,
    			"exam_mark"=>$eMark,
    			"exam_col"=>$eCol,
    			"stt"=>0
    			);
    	return $this->insert($data);
    }
    
    public function updateExamTemp($eTempID,$eID,$eTeacherID,$eMark,$eCol){
    	$data = array(
    			"exam_id"=>$eID,
    			"exam_teacher_id"=>$eTeacherID,
    			"exam_mark"=>$eMark,
    			"exam_col"=>$eCol,
    			"stt"=>0
    			);
    	return $this->update($data, "exam_temp_id = $eTempID");
    }

}

